package test.db.table.oracle.type;

import test.db.table.Table;

/**
 * @author newbie
 * @since 0.1
 */
public enum PwCounterTable implements Table, ColumnType {
    SID(Column.sid),
    IP(Column.ip),
    REFERER(Column.referer),
    BROWSER(Column.browser),
    OS(Column.os),
    DAYOFWEEK(Column.dayOfWeek),
    REGIST_DATE(Column.registDate),
    REGIST_TIME(Column.registTime);

    private final Column column;

    private static final String TYPE_IP = "VARCHAR2(32)";
    private static final String TYPE_REFERRER = "VARCHAR2(255)";
    private static final String TYPE_BROWSER = "VARCHAR2(255)";
    private static final String TYPE_OS = "VARCHAR2(255)";
    private static final String TYPE_DAYOFWEEK = "VARCHAR2(1)";

    PwCounterTable(Column column) {
        this.column = column;
    }

    private enum Column {
        sid {
            String getType() {
                return TYPE_SID;
            }
        },
        
        ip {
            String getType() {
                return TYPE_IP;
            }
        },
        
        referer {
            String getType() {
                return TYPE_REFERRER;
            }
        },
        
        browser {
            String getType() {
                return TYPE_BROWSER;
            }
        },
        
        os {
            String getType() {
                return TYPE_OS;
            }
        },
        
        dayOfWeek {
            String getType() {
                return TYPE_DAYOFWEEK;
            }
        },
        
        registDate {
            String getType() {
                return TYPE_REGIST_DATE;
            }
        },

        registTime {
            String getType() {
                return TYPE_REGIST_TIME;
            }
        };

        abstract String getType();
    }

    public String getType() {
        return column.getType();
    }

    public void initData() throws Exception {
    }
}